<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta charset="UTF-8">
<title>用户注册</title>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/libs/font-awesome.css"/>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/common.css"/>
<!-- <link href='//fonts.googleapis.com/css?family=Open+Sans:400,600,700,300|Titillium+Web:200,300,400' rel='stylesheet' type='text/css'> -->
<link rel="stylesheet" type="text/css" href="__CSS__/member_login.css"/>
<script src="__PUBLIC__/js/jquery.js"></script>
<!--[if lt IE 9]>
<script src="__PUBLIC__/js/html5shiv.js"></script>
<script src="__PUBLIC__/js/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="header-wrap">
	<header class="public-head-layout wrapper">
		<h1 class="site-logo">
			<a href="{:url('index/index/index')}"><img src="__PUBLIC__/images/logo.png" class="pngFix"></a>
		</h1>
		<div class="nc-login-now">
			<span>我已经注册，现在就<a href="{:url('user/login/index')}" title="" class="register">登录</a></span>
		</div>
	</header>
</div>
<!-- PublicHeadLayout End -->
<div class="nc-register-bg">
	<div class="nc-register-box">
		<div class="nc-register-layout">
			<div class="left">
				<div class="nc-register-mode">
					<ul class="tabs-nav">
						<li><a href="#default" class="tabulous_active">账号注册<i></i></a></li>
					</ul>
					<div id="tabs_container" class="tabs-container">
						<div id="default" class="tabs-content">
							<form id="register_form" class="nc-login-form"  method="post" >
								<dl>
									<dt>用户名：</dt>
									<dd>
										<input type="text" id="username" name="username" class="text" placeholder="请使用3-15个中、英文、数字及“-”符号"/>
									</dd>
								</dl>
								<dl>
									<dt>设置密码：</dt>
									<dd>
										<input type="password" id="password" name="password" class="text" placeholder="6-20个大小写英文字母、符号或数字"/>
									</dd>
								</dl>
								<dl>
									<dt>确认密码：</dt>
									<dd>
										<input type="password" id="repassword" name="repassword" class="text" placeholder="请再次输入密码"/>
									</dd>
								</dl>
								<dl class="mt15">
									<dt>邮箱：</dt>
									<dd>
										<input type="text" id="email" name="email" class="text" placeholder="输入常用邮箱作为验证及找回密码使用"/>
									</dd>
								</dl>
								<div class="code-div mt15">
									<dl>
										<dt>验证码：</dt>
										<dd>
											<input type="text" id="verify" name="verify" class="text w80" size="10" placeholder="输入验证码" />
										</dd>
									</dl>
									<span><img src="{:url('user/index/verify')}" id="codeimage"/> <a class="makecode" href="javascript:void(0)">看不清，换一张</a></span>
								</div>
								<dl class="clause-div">
									<dd>
										<input name="agree" type="checkbox" class="checkbox" id="clause" value="1" checked="checked" />
									阅读并同意<a href="{:url('index/content/detail?model_id=4&name=agreement')}" target="_blank" class="agreement" title="阅读并同意">《服务协议》</a>
									</dd>
								</dl>
								<div class="submit-div">
									<input type="submit" id="Submit" value="立即注册" class="submit"/>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
			<div class="right">
				<div class="reister-after">
					<h4>注册之后您可以</h4>
					<ol>
						<li><i class="fa fa-book"></i> 购买在线图书</li>
					</ol>
				</div>
			</div>
		</div>
	</div>
</div>
<div id="footer" class="wrapper">
	<p><a href="{:url('index/index/index')}">首页</a>
	| <a  href="{:url('user/index/index')}">会员中心</a>
	</p>
	Copyright 2015 <a href="http://www.tensent.cn" target="_blank">腾速科技</a> All rights reserved.<br/>
</div>
</body>
</html>
<script src="__PUBLIC__/js/messager.js"></script>
<script type="text/javascript">
$(function(){

	/* 登陆表单获取焦点变色 */
	$(".login-form").on("focus", "input", function(){
		$(this).closest('.item').addClass('focus');
	}).on("blur","input",function(){
		$(this).closest('.item').removeClass('focus');
	});

	//表单提交
	$(document).ajaxStart(function(){
		$("button:submit").addClass("log-in").attr("disabled", true);
	}).ajaxStop(function(){
		$("button:submit").removeClass("log-in").attr("disabled", false);
	});

	$("form").submit(function(){
		var self = $(this);
		$.post(self.attr("action"), self.serialize(), success, "json");
		return false;

		function success(data){
			if(data.code){
				window.location.href = data.url;
			} else {
				$.messager.show(data.msg, {placement: 'center',type:'success'});
				//刷新验证码
				$(".makecode").click();
			}
		}
	});
	//初始化选中用户名输入框
	$("#itemBox").find("input[name=username]").focus();
	//刷新验证码
	var verifyimg = $("#codeimage").attr("src");
	$(".makecode").click(function(){
		if( verifyimg.indexOf('?')>0){
			$("#codeimage").attr("src", verifyimg+'&random='+Math.random());
		}else{
			$("#codeimage").attr("src", verifyimg.replace(/\?.*$/,'')+'?'+Math.random());
		}
	});

	//placeholder兼容性
	//如果支持 
	function isPlaceholer(){
		var input = document.createElement('input');
		return "placeholder" in input;
	}
	//如果不支持
	if(!isPlaceholer()){
		$(".placeholder_copy").css({display:'block'})
		$("#itemBox input").keydown(function(){
			$(this).parents(".item").next(".placeholder_copy").css({display:'none'})                    
		})
		$("#itemBox input").blur(function(){
			if($(this).val()==""){
				$(this).parents(".item").next(".placeholder_copy").css({display:'block'})                      
			}
		})
	}
});
</script>